<?php 
  
    $id = $_GET['id'];
    $sql = "SELECT monhoc . * , hocsinh . *,hocsinh_monhoc.*
            FROM `monhoc`
            LEFT JOIN hocsinh_monhoc ON monhoc.id = hocsinh_monhoc.id_mon
            LEFT JOIN hocsinh ON hocsinh.mahs = hocsinh_monhoc.id_hs WHERE monhoc.id=".$id;
    $arr = $db->GetAll($sql);
    //print_r($arr);
    if(count($arr)!=0){
          $tplabc = new XTemplate('sites/views/hocsinh/list.html');
        foreach($arr as $value){
			$tplabc->insert_loop('MON.HOCSINH', array('HOCSINH'=>$value));
		}
        $tplabc->assign('idmon',$id);
        $tplabc->parse('MON');
        $maincontent=$tplabc->text('MON');
      
    }else{
        echo "Không có dữ liệu";
    }
   
?>